home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 98
/
Skunkware 98.iso
/
src
/
mail
/
pine3.96.tar.gz
/
pine3.96.tar
/
pine3.96
/
pine
/
osdep
/
postreap.wtp
< prev
next >
Wrap
Text File
|
1996-05-14
|
877b
|
36 lines
/*======================================================================
post_reap
Manage exit status collection of a child spawned to handle posting
====*/
#if defined(BACKGROUND_POST) && defined(SIGCHLD)
/*----------------------------------------------------------------------
Check to see if we have any posting processes to clean up after
Args: none
Returns: any finished posting process reaped
----*/
post_reap()
{
WaitType stat;
int r;
if(ps_global->post && ps_global->post->pid){
r = waitpid(ps_global->post->pid, &stat, WNOHANG);
if(r == ps_global->post->pid){
ps_global->post->status = WIFEXITED(stat) ? WEXITSTATUS(stat) : -1;
ps_global->post->pid = 0;
return(1);
}
else if(r < 0 && errno != EINTR){ /* pid's become bogus?? */
fs_give((void **) &ps_global->post);
}
}
return(0);
}
#endif